let's discuss developing
microservices using no Js. The no Js applications that you
created during the earlier sessions, such as customer service, product service
and user service are all individual applications that can be attached
together to form microservices. Consider a streaming application that
enables you to watch movies on any smart device. The application provides multiple
features to all its registered users. You need to register with the application
to access some of its features. Now look at the steps to create
microservices in order to get registered with the application, you need to follow
these steps, create a user service. No Js application that works
with the user details which are your details in this case,
create a movie service node. Js application that works
with the movie details and link your favorite list or
a watch later list. Not all users can add movies to their
favorite list or a watch later list. Thus you need to ensure that if you
are a registered user with valid log in credentials then you'll be
able to access this feature. Let's see an example for microservices. If you want to log in, the rest client
will send a token as a part of the user authentication service where you will
be entering your login credentials to save in the user authentication service,
then you'll be registered as a new user. After registering successfully,
you can access the movie details only with a token that is
included in user movie service. If you are a registered user
you can access the data. Many applications use this
token to access the pattern, for example during online shopping
the application will allow you to make a payment or place an order
only if you are a registered user. So how does the application work? First arrest call is made from
the client to user movie service to get registered as a new user. Once registered,
the client will be directed to log in. Thus the client needs to save the user
in user authentication service. Then the client will be
logged into the system and AJ Sun web token or
JWT is generated using the JWT. The client can perform all the operations
that is create read, update and delete. My SQL is the back end for
user authentication service where it stores all the details
regarding user login. And MongoDB is the back end for user movie service where it stores
all the details regarding data.